Hello and welcome.
In this lecture we are going to create the functionality for our IRS news feed using javascript.
I have attached the javascript to our history AML files so if you open up the demo file I have attached
the script for this project to make it to make the news feed properly.
So this script I've had ideas from line 19 to line 27 so write out and create a separate script and
reference it.
I am actually attached to it.
If you notice have attached the script sharps before the close in body tag or right.
Thus the beginning of the script here on line 19 and that's the end on line 27.
The reason you attach this script to the close embodied just before the closing body tag is that it
enables all the other content on the page to load before discrete is executed right.
So line 19 is defines the opening script inside.
I've got an attribute called type and the value is test slash javascript.
That attribute is not necessary.
This group will still work without it but is just to make it fully compliant but is not necessary to
attach the attribute to the opening script back on line 19 line 20.
I have created a function called load and inside of inside the parenthesis here.
That's all in parenthesis and that includes in online 23.
I have defined a variable chord feed and I have passed the variable.
I've set it to equal to the link you are real to the BBC website where I am picking up the IRS news
feed from.
So this is a link to the you are.
Now the dynamic this feed here.
You can have several You are rails attached or you know wherever you are LS Your like so far as to attach
modern one just so you know separate whether a comma variable or takes once does one date.
So far as I.
I have tried several I probably will have to store them as an array.
Ly 22.
While I've done the line TD 22 they are.
How did he call back.
So I've added a new feed load core back.
Don't forget we had a link here to be Ajax behere on line 10.
Does the link there.
So line 22 there.
Actually what I've done here.
I have created a new have added a new feed load core back so it would be a quad function and the actual
dynamic the dynamic feed control takes either a single feed you are real okay or it can take in and
agree or feed you are real.
So this new this here the field the core back this would be the load core back up past it.
This variable here quad feed right and it takes and also the few control here which is this divide the
sub passed in to Param if us here first is a field which is is variable here that I define defined a
variable down 21 code feed so I'm passing that variable code field a morsel passing it.
This idae here cawfield quantrell so inside this idea is where what this will do it will take over this
I.D. and inject the News Feed inside this idea.
That's what that means are right on line 24.
What I'm doing here I am actually loading so to load the actual Google feed API do that with a Google
dot node module.
Alright the module takes seem to Param if there's the first parameter is truly the model itself and
then the next is the version.
Okay so currently we've got version 1.
Okay so this fits here refresh as reference.
Is so late into the actual model we're using which is the field and the one here refers to the version.
Ah right.
Saw line 24 will be used to load the actual feed line 20.
5 and a synchronoss call-back function so this function is a synchronous back to the google server to
process the feed saw in 25 we process the feed when the page loads are rights or dassin dusts or these
javascript when need to implement this feed.
So just saved that are open on the web browser.
I have also added some biz style in here to our Seer says file gives like one here I'm using the impot
before if you want to use a certain type of stylin you need to import it so less well down here importing
it from this location here.
All right lane 3 basically I've got an idea called feed quantrell and this is what I've got a deep quality
control.
This is what I'm applying to the V to to that day.
So I've got a margin there margin from the top 85 pixels.
That means I want the margin to drop 2 to 5 pixels from the top.
I want it to come down.
So Line 5 of this year says basically what auto means marjane refers to the space outside the element
while padding refers to this space inside.
So margin means from the left and one little centre the div in all corners.
Right so there are four corners.
Top right bottom left lie 7 refers to do with how wide is going to be.
The actual box.
The div maybe 450 440 pixels the size of 25 pixels the size refers to the text.
Again the colour colour refers to the colour of the text inside the border.
Refers to the border around it.
So I want the border to be blue padian refers to this space inside some saying padding from the top.
I want you to move to the five pixels padding from the left.
I want you to move from the left end to 5 pixels and then patter from the right and so on.
So that's the CSF sons have applied to the content of the IRS news feed.
So I'll say just saved that and then let's hear the feed and see what it looks like.
So this is my direct re our click to launch it.
Hopefully everything should be hunky dory.
There we go.
So we seem to have an active news feed so you can see the news feeds that are coming through at the
moment.
You can see it.
It's cool it obsoletes any current information that's been added to the new that you can sell your tells
you there three hours ago something was added and only keeps uploading and then if you're interested
in reading more you just click on the link.
Notice here that the content is being updated automatically have not had to go back to the BBC website
to do something automatically effets true.
That's why his call the feed.
So it gives all the Obleas relating to defeat.
I have specified it so the FT they have several feeds I have only specified the feed relation relating
to World News So that's it for this project you can explore more and also create more fields that peak
your interest.
Thanks for watching.
Oh.
It's been useful.
Bye for now.